﻿<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!--[if lt IE 9]>
<script type="text/javascript" src="../lib/html5.js"></script>
<script type="text/javascript" src="../lib/respond.min.js"></script>
<script type="text/javascript" src="../lib/PIE_IE678.js"></script>
<![endif]-->
    <link href="../css/H-ui.min.css" rel="stylesheet" type="text/css" />
    <link href="../css/H-ui.admin.css" rel="stylesheet" type="text/css" />
    <link href="../lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet" type="text/css" />
    <!--[if IE 6]>
<script type="text/javascript" src="../lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
    <title>生产过程管理</title>

</head>

<body>
    <div class="pd-5">
        <div class="text-c" id="findfdiv">
             

            <input type="text" class="input-text" style="width: 250px" placeholder="输入地块编号" id="findfv1" name="findfv1">
            <button onclick="hcrainpage()" class="btn btn-success radius" id="" name=""><i class="Hui-iconfont">&#xe665;</i> 搜地块信息</button>
        </div>
        <!--       <div class="cl pd-5 bg-1 bk-gray mt-5">
            <span class="l">
                <a href="javascript:;" onclick="toolDelete()" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 删除</a>
                <a href="javascript:;" onclick="toolUpdate()" class="btn btn-secondary radius"><i class="Hui-iconfont">&#xe6df;</i> 修改</a>
                <a href="javascript:;" onclick="toolAdd()" class="btn btn-primary radius"><i class="Hui-iconfont">&#xe600;</i> 添加</a></span>
            <span class="r">操作提示：<strong>^_^</strong> </span>

        </div>-->
        <div id="hcvueapp" class="mt-5 ml-20">
            <div class="panel panel-default" v-for="site in listinfo">
                <div class="panel-header">{{ site.fv1 }}--{{ site.fv2 }}</div>
                <div class="panel-body">
                    <table class="table table-border table-bordered table-hover">
                        <thead>
                            <tr>
                                <th width="20%">任务编号</th>
                                <th>任务种植物</th>
                                <th>作业类型</th>
                                <th>作业</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr v-for="worklist in site.subinfo"   v-bind:class="{ success: worklist.infotype == 11, 'warning': worklist.infotype === 1 }" >
                                <td>{{ worklist.任务编号}}</td>
                                <td>{{ worklist.任务种植物 }}</td>
                                <td>{{ worklist.作业类型 }}</td>
                                <td>
                                    <div v-if="worklist.infotype === 1">
                                        <a style="text-decoration: none" class="ml-5" v-on:click="vueaddTaskListInfo(worklist.任务id,22,site.id,site.fv1,site.nv1)" href="javascript:;" title="清园"><i class="Hui-iconfont">&#xe603;清园</i></a>
                                        <a style="text-decoration: none" class="ml-5" v-on:click="vueaddTaskListInfo(worklist.任务id,33,site.id,site.fv1,site.nv1)" href="javascript:;" title="打地"><i class="Hui-iconfont">&#xe64d;打地</i></a>
                                        <a style="text-decoration: none" class="ml-5" v-on:click="vueaddTaskListInfo(worklist.任务id,44,site.id,site.fv1,site.nv1)" href="javascript:;" title="底肥"><i class="Hui-iconfont">&#xe6d1;底肥</i></a>
                                        <a style="text-decoration: none" class="ml-5" v-on:click="vueaddTaskListInfo(worklist.任务id,55,site.id,site.fv1,site.nv1)" href="javascript:;" title="整地"><i class="Hui-iconfont">&#xe6c9;整地</i></a>
                                        <a style="text-decoration: none" class="ml-5" v-on:click="vueaddTaskListInfo(worklist.任务id,66,site.id,site.fv1,site.nv1)" href="javascript:;" title="播种"><i class="Hui-iconfont">&#xe6d3;播种</i></a>
                                        <a style="text-decoration: none" class="ml-5" v-on:click="vueaddTaskListInfo(worklist.任务id,77,site.id,site.fv1,site.nv1)" href="javascript:;" title="水肥"><i class="Hui-iconfont">&#xe6b2;水肥</i></a>
                                        <a style="text-decoration: none" class="ml-5" v-on:click="vueaddTaskListInfo(worklist.任务id,88,site.id,site.fv1,site.nv1)" href="javascript:;" title="植保"><i class="Hui-iconfont">&#xe6ac;植保</i></a>
                                        <a style="text-decoration: none" class="ml-5" v-on:click="vueaddTaskListInfo(worklist.任务id,99,site.id,site.fv1,site.nv1)" href="javascript:;" title="育苗"><i class="Hui-iconfont">&#xe6bb;育苗</i></a>
                                        <a style="text-decoration: none" class="ml-5" v-on:click="vueaddTaskListInfo(worklist.任务id,1010,site.id,site.fv1,site.nv1)" href="javascript:;" title="选苗"><i class="Hui-iconfont">&#xe606;选苗</i></a>
                                        <a style="text-decoration: none" class="ml-5" v-on:click="vueaddTaskListInfo(worklist.任务id,1111,site.id,site.fv1,site.nv1)" href="javascript:;" title="采收"><i class="Hui-iconfont">&#xe672;采收</i></a>
                                    </div>
                                    <div v-else-if="worklist.infotype === 11">
                                        <a style="text-decoration: none" class="ml-5" v-on:click="vuetoolUpdateByIdCheckUrl(worklist.作业id,'sctasklist-work-ae1111.html','处理作业信息')" href="javascript:;" title="编辑"><i class="Hui-iconfont">&#xe6df;编辑</i></a>
                                        <a style="text-decoration: none" class="ml-5" v-on:click="vuetoolDelete(worklist.作业id,'hsc_task_info','id')" href="javascript:;" title="删除"><i class="Hui-iconfont">&#xe6e2;删除</i></a>
                                    </div>
                                    <div v-else>
                                        <a style="text-decoration: none" class="ml-5" v-on:click="vuetoolUpdateByIdCheckUrl(worklist.作业id,'sctasklist-work-ae.html','处理作业信息')" href="javascript:;" title="编辑"><i class="Hui-iconfont">&#xe6df;编辑</i></a>
                                        <a style="text-decoration: none" class="ml-5" v-on:click="vuetoolDelete(worklist.作业id,'hsc_task_info','id')" href="javascript:;" title="删除"><i class="Hui-iconfont">&#xe6e2;删除</i></a>
                                    </div>
                                </td>

                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
            <!-- <div v-html="message"></div>
    
            <button v-on:click="greet">Greet</button>-->
            <div class="mt-5 row">
                <div id="page1"></div>
            </div>

        </div>
    </div>

    <script type="text/javascript" src="../lib/layui/layui2.js"></script>
    <script type="text/javascript" src="../js/vue.min.js"></script>
    <script>
        var hcvueapp = new Vue({
            el: '#hcvueapp',
            data: {
                message: '<h1>菜鸟教程</h1>',
                listinfo: []
            },
            methods: {
                vueaddTaskListInfo: function (taskid, workinfotype, infoid, infoname, infomj) {
                    //生产任务ID  生产作业类型 （22清园33打地） 地ID  地编号  地面积
                    if (taskid != "" && taskid != null && taskid != 'undefined') {
                        if (workinfotype == "1111") {
                            toolAdd("添加采摘信息", "sctasklist-work-ae" + workinfotype + ".html?action=add&urltaskid=" + taskid + "&urlinfoid=" + infoid +
                                "&urlinfoname=" + infoname + "&urlinfomj=" + infomj + "&urlworkinfotype=" + workinfotype);
                        }
                        else {
                            toolAdd("添加作业信息", "sctasklist-work-ae.html?action=add&urltaskid=" + taskid + "&urlinfoid=" + infoid +
                                "&urlinfoname=" + infoname + "&urlinfomj=" + infomj + "&urlworkinfotype=" + workinfotype);
                        }
                    }
                    else {
                        layer.alert("请在编辑情况下操作", { icon: 1 });
                    }
                },
                vuetoolUpdateByIdCheckUrl: function (workinfoid, page, name) {
                    toolUpdateByIdCheckUrl(workinfoid, page, name);
                },
                vuetoolDelete: function (workinfoid, table, mkey) {
                    toolDelete(workinfoid, table, mkey);
                }
            }
        })
    </script>
    <script src="../hcjsui/Scripts/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="../lib/layer/1.9.3/layer.js"></script>
    <script type="text/javascript" src="../lib/laypage/1.2/laypage.js"></script>
    <script type="text/javascript" src="../lib/My97DatePicker/WdatePicker.js"></script>
    <script src="../hcjsui/js/_Define.js" type="text/javascript"></script>
    <script type="text/javascript" src="../js/hcui.js"></script>
    <script type="text/javascript" src="../js/hcui_list.js"></script>

    <script type="text/javascript">
        var whereaddinfo = "";
        $(function () {
            spsetBaseNoBt("yw_baseinfo", "id", "yw_baseinfo as T", "*", "#tablelist", "yw_baseinfo", "生产任务管理", "sctaskworklist");
            hcrainpage(1);
        });

        function hcrainpage(curr) {
            var finddcno = $("#findfv1").val();
            if (finddcno) {
                whereaddinfo = " and fv1 like '%" + finddcno + "%'";
            }
            else { whereaddinfo = ""; }
            $.ajax({
                type: "post",
                url: "../ashx/spui.ashx",
                data: {
                    "action": "getpageinfo",
                    "pagenow": curr || 1,
                    "pagesize": 2,
                    "select": "t.*",
                    "table": "yw_baseinfo as t",
                    "group": "",
                    "having": "",
                    "where": " type=2 and  databranchid=" + HCUser.HCUorg + whereaddinfo,
                    "order": "",
                    "subinfo": "任务id,任务编号,任务种植物id,任务种植物,作业id,作业类型,infotype,infobytype1#viewtask_dc_nowwork#地id-@id#任务id,作业时间#"//子查询
                },
                async: true,
                cache: false,
                error: function (error) {

                },
                success: function (data) {
                    var result = JSON.parse(data);
                    hcvueapp.listinfo = result.data;
                    //显示分页
                    laypage({
                        cont: 'page1', //容器。值支持id名、原生dom对象，jquery对象。【如该容器为】：<div id="page1"></div>
                        pages: result.message || 0, //通过后台拿到的总页数
                        curr: curr || 1, //当前页
                        jump: function (obj, first) { //触发分页后的回调
                            if (!first) { //点击跳页触发函数自身，并传递当前页：obj.curr
                                hcrainpage(obj.curr);
                            }
                        }
                    });

                }
            });




        };

        //重新加载-重载
        function findreolad(isback) {
            hcrainpage(1);
        }
    </script>
</body>
</html>
